<?php
/**
 * IMMOPHP
 * ADMINISTRATION 
 * GESTION DES TYPES D ANNONCES
 * http://www.immophp.fr
 * **/
require 'kernel/common.php';

if(!$Session->check_admin()) redirect('index.php');

if(!$type_id = retrieve('GET','type',true)) redirect('type.php?error=no_type_select');

$template->set_filenames(array('type_edition' => 'template/type_edition.tpl'));

$Type = $db->sql_query("SELECT * FROM immo_annonce_type WHERE id = '". $type_id ."'",'ARRAY');

if($db->nb_resultat != 1) redirect('type.php?error=type_not_exist');

$template->assign_vars(array(
'L_TYPE'    =>  $lang['Type'],
'L_EDITION'    =>  $lang['Edition'],
'L_NOM' =>  $lang['Nom'],
'L_ENREGISTRER' =>  $lang['Enregistrer'],
'L_DESCRIPTION' =>  $lang['Description'],
'L_VISIBLE' =>  $lang['Visible'],
'L_OUI' =>  $lang['Oui'],
'L_NON' =>  $lang['Non'],
'L_CONFIRM_SUPPRESSION_TYPE'    =>  $lang['Confirm_supprime_type'],
'V_TOKEN'   =>  $_SESSION['token'],
'V_NOM' =>  stripslashes($Type['nom']),
'V_DESCRIPTION' =>  stripslashes($Type['description']),
'V_VISIBLE' =>  stripslashes($Type['visible']),
'V_TYPE_ID' =>  $type_id,
));
$template->display('type_edition');
require 'footer.php';
?>